<%@page import="java.util.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Merchant Manager</title>
<script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.js"></script>
<link href="https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.css"
	rel="stylesheet">
<link href="./public/css/index.css" rel="stylesheet">
</head>

<body>
	<div class="div-body">
		<div class="nav-title-bar">
			<span>AMC-Admin</span>
		</div>

		<div class="content-menu">
			<ul class="content-menu-ul">
				<li>Menu 1</li>
				<li>Menu 2</li>
			</ul>
		</div>

		<div class="content-content">

			<div class="table-menu" align="right">
				<select id="sel" onchange="change()" name="menuList" class="select">
				<c:if test="${isBlackFlag == '0'}">
					<option class="select-item" value="0" selected>Normal List</option>
					<option class="select-item" value="1" >Black List</option>
					<option class="select-item" value="" >ALL</option>
				</c:if>
				<c:if test="${isBlackFlag == '1'}">
					<option class="select-item" value="0" >Normal List</option>
					<option class="select-item" value="1" selected>Black List</option>
					<option class="select-item" value="" >ALL</option>
				</c:if>
				<c:if test="${empty isBlackFlag }">
					<option class="select-item" value="0" >Normal List</option>
					<option class="select-item" value="1" >Black List</option>
					<option class="select-item" value="" selected>ALL</option>
				</c:if>
				</select>
			</div>

			<table align="center">
				<tbody>
					<tr>
						<th>Name</th>
						<th>Address</th>
						<th>Pic</th>
						<th>Id-Card</th>
						<th>Audit-Status</th>
						<th>Remarks</th>
						<th>Operation</th>
					</tr>
					<c:forEach items="${merchantList}" var="item">
						<tr>
							<td>${item.merchantName }</td>
							<td>${item.merchantAddress }</td>
							<td><img src="${item.merchantPic }" style="width:80px;height:80px"/></td>
							<td><img src="${item.merchantIdcard } "style="width:120px;height:80px"/></td>
							<td><c:if test="${item.auditStatus == 0}">审核通过</c:if>
							<c:if test="${item.auditStatus == 1}">审核驳回</c:if>
							<c:if test="${item.auditStatus == 2}">待审核</c:if>
							</td>
							<td>${item.remarks }</td>

							<td class="option-btn">
								
								<c:if test="${item.auditStatus == 2 || item.auditStatus == 1}">
									<button class="apply-button" name="${item.merchantId}">确认通过</button>
									<button class="reject-button" name="${item.merchantId}">驳回</button>
								</c:if>
								<c:if test="${item.isBlack == 0}">
									<button class="black-button" name="${item.merchantId}"
										value="1">加入黑名单</button>
								</c:if> <c:if test="${item.isBlack == 1}">
									<button class="black-button"
										style="background-color: #ffffff; color: #000000;"
										name="${item.merchantId}" value="0">加入白名单</button>
								</c:if>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>

		<div id="rejectDialo" style="display: none;" title="Reject Remarks">
			<input type="text" class="dialog-input" name="remarks" id="remarks"
				placeholder="Please Input The Remarks..." /> <input type="button"
				id="reject-action" value="Reject" class="reject-button">
		</div>
	</div>
</body>
<script src="./public/js/index.js"></script>
</html>